package eight;

import static util.Print.print;

/**
 * Created by ab on 2016/11/3.
 *
 */

class Super{
    public  int field=0;
    public int getField(){return field;}
}

class Sub extends Super{
    public  int field=1;
    public int getField(){return field;}
    public int getSuperField(){return super.field;}
}

public class lesson4 {
    public static void main(String[] args){
        Super sup=new Sub();
        print("sup.field "+sup.field+" sup.getField "+sup.getField());//UpCast
        Sub sub=new Sub();
        print("sup.field "+sup.field+" sup.getField "+sup.getField()+" sub.getSuperField "+sub.getSuperField());

    }
}
